<template>
  <div class="home-box">
    <Header v-if="store.isHeader"></Header>
    <div class="home-content">
      <div class="home-nav">
        <Navigation />
      </div>
      <div class="home-router">
        <RouterTabs v-if="store.isHeader" :maxNumber="25" />
        <el-scrollbar>
          <div class="home-router-view">
            <router-view v-slot="{ Component }">
              <keep-alive :include="['modelView']">
                <component :is="Component" />
              </keep-alive>
            </router-view>
          </div>
        </el-scrollbar>
      </div>
    </div>
  </div>
</template>

<script setup>
import Navigation from "@/components/Navigation/Navigation.vue";
import Header from "@/components/Header.vue";
import RouterTabs from "@/components/RouterTabs/RouterTabs.vue";
import useStore from "@/store/store.js";
import { useRoute } from "vue-router";

// 获取当前的路由
const route = useRoute();

const store = useStore();
</script>

<style lang="scss" scoped>
.home-box {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  .home-content {
    display: flex;
    flex: 1;
    overflow: hidden;

    .home-nav {
      height: 100%;
    }
    .home-router {
      flex: 1;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      // border: 1px solid #aa55ff;
      .home-router-view {
        width: 100%;
        overflow-y: auto;
        box-sizing: border-box;
        padding: 20px;
        // border: 1px solid red;
      }
    }
  }
}
</style>
